import { request, config } from '../utils'
import * as commonService from './common'

const {api: {financialBalanceChangingApply}} = config

export async function list () {
  const url = `${financialBalanceChangingApply}/list`
  return request({url: url, method: 'POST', data: {}})
}

export async function query (params = {}) {
  params.apiBaseUrl = `${financialBalanceChangingApply}`
  return commonService.commonQuery(params)
}

export async function store (params = {}) {
  const url = `${financialBalanceChangingApply}/create`
  return request({url: url, method: 'POST', data: params})
}

export async function update (params = {}) {
  const url = `${financialBalanceChangingApply}/update`
  return request({url: url, method: 'PUT', data: params})
}

export async function publish (params = {}) {
  const url = `${financialBalanceChangingApply}/publish`
  return request({url: url, method: 'PUT', data: params})
}

export async function audit (params = {}) {
  const url = `${financialBalanceChangingApply}/audit`
  return request({url: url, method: 'PUT', data: params})
}

export async function cancel (params = {}) {
  const url = `${financialBalanceChangingApply}/delete`
  return request({url: url, method: 'PUT', data: params})
}

export async function shopOverall () {
  const url = `${financialBalanceChangingApply}/shopOverall`
  return request({url: url, method: 'GET', data: {}})
}
